import request from '@/utils/request'

// 查询采购计划.审批通过后生成招标项目列表
export function listPurs(query) {
  return request({
    url: '/purs/purs/list',
    method: 'get',
    params: query
  })
}

// 查询采购计划.审批通过后生成招标项目详细
export function getPurs(planCode) {
  return request({
    url: '/purs/purs/' + planCode,
    method: 'get'
  })
}

// 新增采购计划.审批通过后生成招标项目
export function addPurs(data) {
  return request({
    url: '/purs/purs',
    method: 'post',
    data: data
  })
}

// 修改采购计划.审批通过后生成招标项目
export function updatePurs(data) {
  return request({
    url: '/purs/purs',
    method: 'put',
    data: data
  })
}

// 删除采购计划.审批通过后生成招标项目
export function delPurs(planCode) {
  return request({
    url: '/purs/purs/' + planCode,
    method: 'delete'
  })
}


//获取采购计划编号
export function getPurCode(code) {
  return request({
    url: '/purs/purs/getCode/' + code,
    method: 'get'
  })
}

//删除文件
export function deleteFile(filesName) {  
  return request({
    url: '/purs/file/delFiles/'+filesName,
    method: 'get'
  })
}


//获取采购计划详细信息
export function getPlanDetails(planCode) {  
  return request({
    url: '/purs/purs/getPlanDetails/'+planCode,
    method: 'get'
  })
}

//获取未执行采购寻源的计划
export function getPlanFinish() {  
  return request({
    url: '/purs/purs/getPlanFinish',
    method: 'get'
  })
}

//获取最新四条寻源计划
export function getPlanFinishNewBest() {  
  return request({
    url: '/purs/purs/getPlanFinishNewBest',
    method: 'get'
  })
}



//通过采购计划编号删除所有信息
export function delPursByPlanCode(planCode) {
  return request({
    url: '/purs/purs/clearByPlanCode/' + planCode,
    method: 'delete'
  })
}




